/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ADMIN
 */
@Entity
@Table(catalog = "EASYTICKETS", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "CardType.findAll", query = "SELECT c FROM CardType c"),
    @NamedQuery(name = "CardType.findByCardTypeId", query = "SELECT c FROM CardType c WHERE c.cardTypeId = :cardTypeId"),
    @NamedQuery(name = "CardType.findByTypeName", query = "SELECT c FROM CardType c WHERE c.typeName = :typeName"),
    @NamedQuery(name = "CardType.findByStatus", query = "SELECT c FROM CardType c WHERE c.status = :status")})
public class CardType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(nullable = false)
    private Integer cardTypeId;
    @Size(max = 10)
    @Column(length = 10)
    private String typeName;
    private Boolean status;
    @OneToMany(mappedBy = "cardType")
    private List<Payment> paymentList;

    public CardType() {
    }

    public CardType(Integer cardTypeId) {
        this.cardTypeId = cardTypeId;
    }

    public Integer getCardTypeId() {
        return cardTypeId;
    }

    public void setCardTypeId(Integer cardTypeId) {
        this.cardTypeId = cardTypeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public List<Payment> getPaymentList() {
        return paymentList;
    }

    public void setPaymentList(List<Payment> paymentList) {
        this.paymentList = paymentList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cardTypeId != null ? cardTypeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CardType)) {
            return false;
        }
        CardType other = (CardType) object;
        if ((this.cardTypeId == null && other.cardTypeId != null) || (this.cardTypeId != null && !this.cardTypeId.equals(other.cardTypeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ejb.entity.CardType[ cardTypeId=" + cardTypeId + " ]";
    }
    
}
